function bondForce(frame,forces) {
    var atom1;
    var atom2;
    var atom1pos;
    var atom2pos;

    var bond = trajectory.bonds;

    for (var i = 0; i < trajectory.bonds.length; i++) // loop over every bond
    {
        atom1 = frame.atoms[parseFloat(bond[i].atoms[0])];
        atom2 = frame.atoms[parseFloat(bond[i].atoms[1])];

        // Get the bond parameters
        var equilibrium = bond[i].equilibrium;
        var constant = bond[i].constant;

        // Get the vector pointing from otherAtom to thisAtom
        var distanceVector = atom1.pos.sub(atom2.pos);

        // Calculate the harmonic bond force and energy of the two atoms
        var bondEnergy = constant *Math.pow(distanceVector.norm() - bond[i].equilibrium,2);

        var bondForce = distanceVector.unit().scale(constant *(-Math.pow(distanceVector.norm() - bond[i].equilibrium,2) ));
        // console.log(bondForce)

        // add these forces to the two atoms in the bond
        forces[bond[i].atoms[0]].$add(bondForce);
        forces[bond[i].atoms[1]].$add(bondForce.scale(-1));

        frame.potentialEnergy += bondEnergy;
        // console.log(forces[i]);
    }

    return forces;
}